package com.jp.knowledge.my.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;

import com.jp.knowledge.R;
import com.jp.knowledge.my.base.RecycleVAdapter;
import com.jp.knowledge.my.base.RecycleVHolder;

import java.util.Arrays;

public class OptionAdapter extends RecycleVAdapter<String> {

    public OptionAdapter(Context context, @NonNull String[] arr) {
        super(context, Arrays.asList(arr));
    }

    public void updateAdapter(@NonNull String[] arr) {
        super.updateAdapter(Arrays.asList(arr));
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_search_data;
    }

    @Override
    public void onBind(RecycleVHolder holder, int position) {
        String time = getData(position);
//        holder.getConvertView().setPadding(holder.getConvertView().getPaddingLeft(),
//                ((int)context.getResources().getDimension(R.dimen.space_big_more)),
//                holder.getConvertView().getPaddingRight(),
//                ((int)context.getResources().getDimension(R.dimen.space_big_more)));
        holder.getImageView(R.id.item_data_iv_logo).setVisibility(View.GONE);
        holder.setTextView(R.id.item_data_tv_name, time);
    }
}
